From: Eli Zaretskii Date: Mon, 19 Apr 2010 12:12:13 +0000 (+0300) Subject: Fix crashes in GC in "emacs -nw". X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~8108 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=8e964cda6b5b34e224bbaae1745e55f605560ff1;p=emacs.git Fix crashes in GC in "emacs -nw". xdisp.c (display_line): Don't write beyond the last glyph row in the desired matrix. Fixes crashes in "emacs -nw", see http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00075.html and http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00213.html --- diff --git a/src/ChangeLog b/src/ChangeLog index 1c9ceddccf4..4f9adcb2a59 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2010-04-19 Eli Zaretskii + + * xdisp.c (display_line): Don't write beyond the last glyph row in + the desired matrix. Fixes a crash in "emacs -nw", see + http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00075.html + and + http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00213.html + 2010-04-18 Stefan Monnier * alloc.c (Fpurecopy): Hash-cons if requested. diff --git a/src/xdisp.c b/src/xdisp.c index 57f75cedf8d..d0bf26e1f00 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -17808,10 +17808,12 @@ display_line (it) it->current_y += row->height; ++it->vpos; ++it->glyph_row; - /* The next row should use same value of the reversed_p flag as this - one. set_iterator_to_next decides when it's a new paragraph, and - PRODUCE_GLYPHS recomputes the value of the flag accordingly. */ - it->glyph_row->reversed_p = row->reversed_p; + /* The next row should by default use the same value of the + reversed_p flag as this one. set_iterator_to_next decides when + it's a new paragraph, and PRODUCE_GLYPHS recomputes the value of + the flag accordingly. */ + if (it->glyph_row < MATRIX_BOTTOM_TEXT_ROW (it->w->desired_matrix, it->w)) + it->glyph_row->reversed_p = row->reversed_p; it->start = row_end; return row->displays_text_p; }